/**
 * 
 */
package org.mhz.ootw.tree;

import java.util.ArrayList;
import java.util.List;

import org.mhz.ootw.util.JSONHelper;

/**
 * @author Mahan
 *
 * Js tree
 */
public class JsTree
{
    private List<JsTreeNode> mRootNodes;

    /**
     * Default constructor
     */
    public JsTree()
    {
        mRootNodes = new  ArrayList<JsTreeNode>();
    }       

    /**
     * @return Returns the rootNodes.
     */
    public List<JsTreeNode> getRootNodes()
    {
        return mRootNodes;
    }

    /**
     * @param aRootNodes The rootNodes to set.
     */
    public void setRootNodes(final List<JsTreeNode> aRootNodes)
    {
        mRootNodes = aRootNodes;
    }

    /**
     * @return The object as a json string
     */
    public String jsonString()
    {
        return JSONHelper.jsTreeNodesAsJSONString(mRootNodes);
    }

    /* (non-Javadoc)
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString()
    {
        return "JsTree [mTreeNodes=" + mRootNodes + "]";
    }          
}
